package com.lagou.java.pojo;

//import org.springframework.data.annotation.Id;

import javax.persistence.*;

/**
 * 简历实体类
 * 1. 使用注解, 建立实体来和数据表之间的关系, 以及属性和字段的映射关系
 * @Entity
 * @Table
 * 2. 实体类属性和表字段的映射关系
 * 3. @Id 标识主键, @GenerateValue 标识主键生成策略
 * @Column 建立属性和字段映射
 *
 */
@Entity
@Table(name="tb_resume")
public class Resume {
    @Id
    /**
     * 生成策略经常使用的两种,
     * GenerationType.IDENTITY, 依赖数据库主键自增功能, Mysql
     *          封装了基本的crud操作
     * GenerationType.SEQUENCE, 依靠序列来产生主键, oracle
     *          封装了复杂的查询, 分页/排序
     */
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    private String name;
    private String address;
    private String phone;

    @Override
    public String toString() {
        return "Resume{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", address='" + address + '\'' +
                ", phone='" + phone + '\'' +
                '}';
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }
}


